import 'package:fwanandroid/model/api/exceptions/ApiException.dart';
import 'package:fwanandroid/model/api/exceptions/HttpException.dart';
import 'package:toast/toast.dart';

class ToastUtil {
  static void show(String content) {
    Toast.show(content, duration: Toast.lengthLong, gravity: Toast.bottom);
  }

  static void showByError(error) {
    if (error is HttpException) {
      ToastUtil.show("${error.message}");
    } else {
      ToastUtil.show(error.toString());
    }
  }
}
